package com.zhongfl.crm.enums.boss;

import com.zhongfl.crm.exception.EnumParseException;
import lombok.Getter;

/**
 * OrderMemorandumSyncStatusEnum 备忘录同步状态枚举
 *
 * @author tiantian
 * @date 2018/6/28 11:14
 */
@Getter
public enum OrderMemorandumSyncStatusEnum {

    UN_SYNC(0,"未同步"),

    PROCESSING_SYNC(1,"同步处理中"),

    FAIL_SYNC(2,"同步失败"),

    SUCCESS_SYNC(3,"同步成功");

    private int key;
    private String desc;

    OrderMemorandumSyncStatusEnum(int key, String desc) {
        this.key=key;
        this.desc = desc;
    }

    public static OrderMemorandumSyncStatusEnum valueOf(int key) {
        for (OrderMemorandumSyncStatusEnum statusEnum : OrderMemorandumSyncStatusEnum.values()) {
            if (statusEnum.getKey() == key) {
                return statusEnum;
            }
        }
        throw new EnumParseException(OrderMemorandumSyncStatusEnum.class, String.valueOf(key));
    }
}
